﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;


/// <summary>
/// Summary description for optionDAL
/// </summary>
public class optionDAL
{
    DataAccess da = new DataAccess();
	public optionDAL()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    public DataTable getAllOptionByProductId(int product_id)
    {
        SqlParameter[] paramList = new SqlParameter[3];
        paramList[1]=da.AddParameter("product_id", product_id, SqlDbType.Int);
        paramList[0]=da.AddParameter("product_option_id", DBNull.Value, SqlDbType.Int);
        paramList[0]=da.AddParameter("product_option_des", DBNull.Value, SqlDbType.NVarChar,255);
        return da.executeSelect("Select_po", paramList);
    }
    public DataTable getOptionValueByOptionID(int product_option_id){
        SqlParameter[] paramList = new SqlParameter[3];
        paramList[1] = da.AddParameter("product_id", DBNull.Value, SqlDbType.Int);
        paramList[0] = da.AddParameter("product_option_id", product_option_id, SqlDbType.Int);
        paramList[0] = da.AddParameter("product_option_des", DBNull.Value, SqlDbType.NVarChar, 255);
        return da.executeSelect("Select_po", paramList);
    }
    public DataTable getAllOptionByOptionDes(string product_option_des)
    {
        SqlParameter[] paramList = new SqlParameter[3];
        paramList[1] = da.AddParameter("product_id", DBNull.Value, SqlDbType.Int);
        paramList[0] = da.AddParameter("product_option_id", DBNull.Value, SqlDbType.Int);
        paramList[0] = da.AddParameter("product_option_des", product_option_des, SqlDbType.NVarChar, 255);
        return da.executeSelect("Select_po", paramList);
    }
    
}